<template>
  <view style="width: 100%; height: 100%" v-if="url">
    <iframe style="width: 100%; height: 100vh; border: 0" frameborder="0" :src="url"></iframe>
  </view>
</template>
<script setup name="Question">
import Cookies from "js-cookie";
import { inject, onMounted } from "vue";
const host = inject("host");
const url = ref(null);
onMounted(() => {
  let selectedExam = Cookies.get("selectedExam");
  selectedExam = JSON.parse(selectedExam);
  url.value =  "http://viewer.apisev.cn/viewer/preview/remote?url=" + encodeURIComponent(selectedExam.questionUrl);
  console.log(url.value);
});
</script>
